package org.code.mallspringboot.controller;

import io.swagger.v3.oas.annotations.Operation;
import org.code.mallspringboot.pojo.UmsRole;
import org.code.mallspringboot.service.UmsRoleService;
import org.code.mallspringboot.vo.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 后台用户角色管理
 * @author jamie
 * @date 2024/9/30
 */
@RestController
@RequestMapping("/role")
public class UmsRoleController {

    @Autowired
    private UmsRoleService umsRoleService;

    @Operation(summary = "获取所有角色")
    @GetMapping(value = "/listAll")
    public CommonResult<List<UmsRole>> listAll() {
        List<UmsRole> roleList = umsRoleService.list();
        return CommonResult.success(roleList);
    }

}
